(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    ["pages/main/storehouse/scanlexq"], {
        "16e5": function (t, e, n) {
            "use strict";
            (function (t) {
                function n2(e) {
                    var t = new Date,
                        o = t.getFullYear(),
                        a = t.getMonth() + 1,
                        r = t.getDate();
                    return "start" === e ? o -= 10 : "end" === e && (o += 10), a = a > 9 ? a : "0" + a, r = r > 9 ? r : "0" + r, "".concat(o, '-').concat(a, '-').concat(r)
                }
                var o = n("4ea4");
                Object.defineProperty(e, "__esModule", {
                    value: !0
                }), e.default = void 0;
                var i = o(n("2eee")),
                    a = o(n("c973")),
                    u = {
                        data: function () {
                            return {
                                startDate: n2("start"),
                                endDate: n2("end"),
                                model: {
                                    xsname: "",
                                    goodsname: "",
                                    goodsno: ""
                                },
                                date: n2({
                                    format: !0
                                }),
                                dateend: n2({
                                    format: !0
                                }),
                                goods: [],
                                startTime: "",
                                endTime: "",
                                url: getApp().globalData.apiurl,
                                source: 0,
                                loadingType: "more",
                                totalCount: 0,
                                totalPages: 1,
                                pageSize: 10,
                                pageIndex: 1,
                                listData: [],
                                scrollHeight: 0,
                                pageNum: 0
                            }
                        },
                        methods: {
                            // 开始时间
                            bindDateChange: function (e) {
                                console.log("开始时间")
                                if (this.handleTime(true,e.detail.value)) return this.date = e.detail.value;
                                wx.showToast({
                                    title: "开始时间不得大于结束时间！",
                                    icon: "none",
                                    duration: 2000
                                });
                            },
                            // 结束时间
                            bindDateChangeend: function (e) {
                                if (this.handleTime(false,e.detail.value)) return this.dateend = e.detail.value
                                wx.showToast({
                                    title: "结束时间不得小于开始时间！",
                                    icon: "none",
                                    duration: 2000
                                });
                            },
                            // 时间判断
                            handleTime(state,time) {
                                let t = [];
                                let t2 = [];
                                let enums = ''; // 结束时间
                                let snum = ''; // 开始时间
                                if(state){
                                    t2 = time.split("-"); // 当前选中的开始时间
                                    t = this.dateend.split("-");
                                }else{
                                    t = time.split("-");
                                    t2 = this.date.split("-");
                                }
                                t.forEach((item, index) => {
                                    enums += item;
                                    snum += t2[index];
                                })
                                if (parseInt(enums) == parseInt(snum)) return true;
                                if (parseInt(enums) > parseInt(snum)) return true;
                                return false;

                                if (state) { // 选择开始时间事件
                                    if (parseInt(enums) > parseInt(snum)) {

                                        return true;
                                    }
                                    return true;
                                } else {

                                    debugger;
                                    if (parseInt(enums) < parseInt(snum)) {

                                        return true;
                                    }

                                }
                                return false;
                            },
                            downLoad: function (e) {
                                var t = this;
                                console.log(t.totalPages)
                                console.log(t.pageNum)
                                if (t.totalPages < t.pageNum) {
                                    this.getdata()
                                }
                            },
                            loadData: function () {
                                var t = arguments,
                                    e = this;
                                return (0, a.default)(i.default.mark((function n() {
                                    return i.default.wrap((function (n) {
                                        while (1) switch (n.prev = n.next) {
                                            case 0:
                                                t.length > 0 && void 0 !== t[0] ? t[0] : "add", t.length > 1 ? t[1] : void 0, e;
                                            case 3:
                                            case "end":
                                                return n.stop()
                                        }
                                    }), n)
                                })))()
                            },
                            refreshList: function (t) {
                                this.loadData("refresh")
                            },
                            deleteItem: function (t) {
                                var e = this;
                                return (0, a.default)(i.default.mark((function n() {
                                    return i.default.wrap((function (n) {
                                        while (1) switch (n.prev = n.next) {
                                            case 0:
                                                e, console.log("删除" + t);
                                            case 2:
                                            case "end":
                                                return n.stop()
                                        }
                                    }), n)
                                })))()
                            },
                            submitForm: function () {
                                var e = this;
                                this.listData = [];
                                t.getStorageSync("key"), getApp().globalData.userinfo.roles[0].roleKey, getApp().globalData.userinfo.nickName;
                                // 时间范围查询
                                // let params = {};
                                // params["beginPurchasetime"] = this.data;
                                // params["endPurchasetime"] = this.dateend;
                                // console.log(params)
                                // params: {
                                //     beginPurchasetime: this.data,
                                //     endPurchasetime: this.dateend,
                                // }
                                // pars.params["%5B"+'endPurchasetime'+"%5D"]= this.dateend,
                                // pars.params["%5B"+'5BbeginPurchasetime'+"%5D"]= this.data,
                                // "%5BbeginPurchasetime%5D": this.date
                                // &params[beginPurchasetime]=2023-05-09&params[endPurchasetime]=2023-05-09
                                let times = {
                                    endPurchasetime: this.dateend + " 24:00:00",
                                    beginPurchasetime: this.date + " 00:00:00"
                                }
                                const pars = {
                                    pageNum: 1,
                                    pageSize: 10,
                                    goodsno: this.model.goodsno,
                                    timerange: times
                                } 
                                console.log(pars);
                                t.request({
                                    url: this.url + "receiptdoc/receiptdoc/list",
                                    header: {
                                        'Content-Type': 'application/json'
                                    },
                                    method: "GET",
                                    data: pars,
                                    success: function (t) {
                                        e.listData = t.data.rows 
                                        e.totalPages = 1;
                                        e.pageNum = t.data.total / e.pageSize ;
                                        console.log(e.pageNum)
                                        e.totalCount = t.data.total;
                                        
                                    },
                                    fail: function () {},
                                    complete: function () {}
                                })
                            },
                            getdata: function () {
                                var n = this;
                                let times = {
                                    endPurchasetime: n.dateend + " 24:00:00",
                                    beginPurchasetime: n.date + " 00:00:00"
                                }
                                const pars = {
                                    pageNum: n.totalPages,
                                    pageSize: n.pageSize,
                                    goodsno: n.model.goodsno,
                                     timerange: times
                                } 
                                console.log(pars)
                                t.request({
                                    url: this.url + "receiptdoc/receiptdoc/list",
                                    method: "GET",
                                    data: pars,
                                    success: function (t) {
                                        //n.listData = t.data.rows, 
                                        t.data.rows.forEach(item => {
                                            n.listData.push(item)
                                        });
                                        // t.listData = e.data.rows,
                                        n.totalPages = n.totalPages + 1
                                        console.log(n.listData)
                                    },
                                    fail: function () {},
                                    complete: function () {}
                                })
                            }
                        },
                        onLoad: function (e) {
                            var n = this;
                            console.log(n.pageSize)
                            let times = {
                                endPurchasetime: n.dateend + " 24:00:00",
                                beginPurchasetime: n.date + " 00:00:00"
                            }
                            const pars = {
                                pageNum: n.totalPages,
                                pageSize: n.pageSize,
                                 timerange: times
                            } 
                           
                            t.request({
                                    url: this.url + "goodsmaintain/goods/list",
                                    method: "GET",
                                    data: {
                                        type: "2"
                                    },
                                    success: function (t) {
                                        n.goods = t.data.rows
                                    },
                                    fail: function () {},
                                    complete: function () {}
                                }),

                              
                                t.request({
                                    url: this.url + "receiptdoc/receiptdoc/list",
                                    method: "GET",
                                    data:pars,
                                    success: function (t) {
                                        n.listData = t.data.rows,
                                            n.totalPages = n.totalPages + 1,
                                            n.pageNum = t.data.total / n.pageSize + 1,
                                            n.totalCount = t.data.total
                                    },
                                    fail: function () {},
                                    complete: function () {}
                                }),
                                wx.getSystemInfo({
                                    success: function (res) {
                                        n.scrollHeight = res.windowHeight - 100
                                    }
                                });
                        },
                        onPullDownRefresh: function () {
                            this.loadData("refresh")
                        },
                        onReachBottom: function () {
                            this.loadData("add")
                        }
                    };
                e.default = u
            }).call(this, n("543d")["default"])
        },
        "214c": function (t, e, n) {
            "use strict";
            n.d(e, "b", (function () {
                return i
            })), n.d(e, "c", (function () {
                return a
            })), n.d(e, "a", (function () {
                return o
            }));
            var o = {
                    uniForms: function () {
                        return Promise.all([n.e("common/vendor"), n.e("components/uni-forms/uni-forms")]).then(n.bind(null, "0933"))
                    },
                    uniFormsItem: function () {
                        return n.e("components/uni-forms-item/uni-forms-item").then(n.bind(null, "4828"))
                    },
                    dtSelect: function () {
                        return n.e("components/dt-select/dt-select").then(n.bind(null, "9fbf"))
                    },
                    uniSwipeAction: function () {
                        return n.e("components/uni-swipe-action/uni-swipe-action").then(n.bind(null, "e7b4"))
                    },
                    uniSwipeActionItem: function () {
                        return Promise.all([n.e("common/vendor"), n.e("components/uni-swipe-action-item/uni-swipe-action-item")]).then(n.bind(null, "c498"))
                    },
                    uniLoadMore: function () {
                        return n.e("components/uni-load-more/uni-load-more").then(n.bind(null, "16c3"))
                    }
                },
                i = function () {
                    var t = this.$createElement;
                    this._self._c
                },
                a = []
        },
        "516a": function (t, e, n) {},
        "84d0": function (t, e, n) {
            "use strict";
            n.r(e);
            var o = n("214c"),
                i = n("ea7a");
            for (var a in i)["default"].indexOf(a) < 0 && function (t) {
                n.d(e, t, (function () {
                    return i[t]
                }))
            }(a);
            n("c7cb");
            var u = n("f0c5"),
                c = Object(u["a"])(i["default"], o["b"], o["c"], !1, null, null, null, !1, o["a"], void 0);
            e["default"] = c.exports
        },
        "94c4": function (t, e, n) {
            "use strict";
            (function (t, e) {
                var o = n("4ea4");
                n("c150"), n("5c17"), n("a9ff");
                o(n("66fd"));
                var i = o(n("84d0"));
                t.__webpack_require_UNI_MP_PLUGIN__ = n, e(i.default)
            }).call(this, n("bc2e")["default"], n("543d")["createPage"])
        },
        c7cb: function (t, e, n) {
            "use strict";
            var o = n("516a"),
                i = n.n(o);
            i.a
        },
        ea7a: function (t, e, n) {
            "use strict";
            n.r(e);
            var o = n("16e5"),
                i = n.n(o);
            for (var a in o)["default"].indexOf(a) < 0 && function (t) {
                n.d(e, t, (function () {
                    return o[t]
                }))
            }(a);
            e["default"] = i.a
        }
    },
    [
        ["94c4", "common/runtime", "common/vendor"]
    ]
]);